package com.mdh.influxdb.pojo;

import com.influxdb.annotations.Column;
import com.influxdb.annotations.Measurement;
import com.mdh.influxdb.controller.InfluxDBController;
import lombok.Data;

import java.time.Instant;

@Data
@Measurement(name = DeviceData.HOME_MEASUREMENT)
public class DeviceData {
    public final static String HOME_MEASUREMENT = "home_device_data";


    @Column(timestamp = true)
    Instant time;
    @Column(tag = true, name = "id")
    private String deviceId;

    @Column(tag = true, name = "key")
    private String key;
    @Column(name = "value")
    private double value;

    public DeviceData() {
    }

    public DeviceData(String deviceId, String key, double value) {
        this.deviceId = deviceId;
        this.key = key;
        this.value = value;
    }
}
